#define _CRT_SECURE_NO_WARNINGS 1

//645 code
int com_int(int *e1, int *e2)
{
	return *e1 - *e2;
}

int* findErrorNums(int* nums, int numsSize, int* returnSize)
{
	*returnSize = 2;
	int *arr = malloc(sizeof(int)* 2);
	qsort(nums, numsSize, sizeof(nums[0]), com_int);
	int i = 0;
	int a = 0;
	for (i = 0; i<numsSize; i++)
	{
		if (nums[i] == a)
			arr[0] = nums[i];
		else if (nums[i] - a>1)
			arr[1] = nums[i] + 1;
		a = nums[i];
	}
	if (nums[numsSize - 1] != numsSize)
		arr[1] = numsSize;
	return arr;
}